import request from "@/utils/request";
//添加反馈
export function addFeedBackApi(feedBack,files){
    const formData = new FormData();
    files.forEach(file => {
        formData.append('images', file);
    });
    return request({
        method:'post',
        url:'/feedback/add',
        params:{
            "user_id":feedBack.user_id,
            "content":feedBack.content,
            "contact_name":feedBack.contact_name,
            "contact_phone":feedBack.contact_phone
        },
        data:formData
    })
}
//更新反馈
export function updateFeedBackApi(feedack){
    return request({
        method:'post',
        url:'/feedback/update',
        data:feedack
    })
}
//删除反馈
export function delFeedBackApi(feedBackId){
    return request({
        method:'delete',
        url:'/feedback/delete',
        params:{
            "feedbackId":feedBackId
        }
    })
}
//查询用户的分页反馈数据
export function getUserFeedBackApi(pageIndex,userId){
    return request({
        method:'get',
        url:'/feedback/find',
        params:{
            "page":pageIndex,
            "userId":userId
        }
    })
}

//获取全部反馈分页列表
export function userGetFeedbackListApi(pageIndex){
    return request({
        method:'get',
        url:'/feedback/find/all',
        params:{
            "page":pageIndex
        }
    })
}